<template>
  <navbar title="订单支付" :isBack="true"></navbar>
  <view class="state flex-direction-column">
    <image :src="`/pagesA/static/image/${params.type == 0 ? 13 : 14}.png`"></image>
    <text>{{ params.type == 0 ? '支付成功' : '支付失败' }}</text>
    <text> {{ params.type == 0 ? '您好，提交的订单已报名成功！' : '您提交的订单报名失败~' }}</text>
  </view>
  <view class="bottom flex-center">
    <view class="btn" @click="btnClick(0)">{{'查看报名'}}</view>
    <view class="btn" @click="btnClick(1)">{{'返回首页'}}</view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import tools from '@/utils/tools'

let params = ref(null)

const btnClick = (way) => {
  if (way == 0) {
		tools.navTo('/pagesA/match/list?id=0', 4)
  } else {
    if (params.value.type == 0) tools.navTo('/pages/match/index', 3)
    else tools.navTo('', 2)
  }
}

onLoad((option) => {
  params.value = JSON.parse(option.params)
	// params.value = {type:0}
})
</script>

<style lang="scss" scoped>
.state {
  margin-top: 226rpx;
  align-items: center;
  justify-content: center;
  image {
    width: 86rpx;
    height: 76rpx;
  }
  text {
    &:nth-child(2) {
      height: 50rpx;
      font-size: 36rpx;
      font-weight: bold;
      line-height: 50rpx;
      margin-top: 28rpx;
    }
    &:nth-child(3) {
      height: 40rpx;
      font-size: 28rpx;
      line-height: 40rpx;
      color: #666666;
      margin-top: 36rpx;
    }
  }
}
.bottom {
  margin-top: 216rpx;
  .btn {
    width: 260rpx;
    height: 84rpx;
    font-size: 32rpx;
    text-align: center;
    line-height: 84rpx;
    border-radius: 10rpx;
    background: rgba(249, 249, 249);
    &:nth-child(1) {
      color: #354678;
      margin-right: 64rpx;
    }
    &:nth-child(2) {
      color: #fff;
      background: linear-gradient(270deg, #354678 0%, #5062A7 100%);
    }
  }
}
</style>
